<?php View::render('admin/layouts/meta'); ?>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 
    <span class="c-gray en">&gt;</span> 商品管理
    <span class="c-gray en">&gt;</span> 积分订单列表 
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <form>
        <div class="text-c">
            <span class="select-box" style="width:100px">
                <select name="payStatus" class="select">
                    <option value="-1" <?php echo $payStatus==-1?'selected="selected"':'';?>>支付状态</option>
                    <option value="0" <?php echo $payStatus==0?'selected="selected"':'';?>>未支付</option>
                    <option value="1" <?php echo $payStatus==1?'selected="selected"':'';?>>已支付</option>
                </select>
            </span>
            <span class="select-box" style="width:150px">
                <select name="orderStatus" class="select">
                    <option value="-1" <?php echo $orderStatus==-1?'selected="selected"':'';?>>订单状态</option>
                    <?php foreach ($orderStatusList as $key=>$value){?>
                    <option value="<?php echo $key;?>" <?php echo $orderStatus==$key?'selected="selected"':'';?>><?php echo $value;?></option>
                    <?php }?>
                </select>
            </span>
            <input type="text" class="input-text" style="width:200px" placeholder="订单号" name="orderNo" value="<?php echo $orderNo;?>">
            <input type="hidden" name="page" value="1"/>
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
    </form>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
        <span class="r">共有数据：<strong><?php echo $total;?></strong> 条</span> 
    </div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="50">ID</th>
                <th width="150">订单号</th>
				<th width="150">订单标题</th>
                <th width="50">积分</th>
				<th width="50">兑换状态</th>
                <th width="50">订单状态</th>
				<th width="50">兑换时间</th>
				<th width="100">添加时间</th>
				<th width="150">操作</th>
			</tr>
		</thead>
		<tbody>
            <?php if($list) {
                foreach ($list as $info){?>
			<tr class="text-c">
				<td><?php echo $info['id'];?></td>
                <td><?php echo $info['order_no'];?></td>
                <td class="text-l"><?php echo $info['title'];?></td>
                <td><?php echo $info['point'];?></td>
				<td><?php echo $info['pay_status']?'已兑换':'未兑换';?></td>
                <td><?php echo isset($orderStatusList[$info['order_status']])?$orderStatusList[$info['order_status']]:$info['order_status'];?></td>
				<td><?php echo $info['pay_time']?date('Y-m-d H:i', $info['pay_time']):'';?></td>
				<td><?php echo $info['add_time'];?></td>
				<td class="td-manage">
                    <a href="javascript:;" style="text-decoration:none" onclick="formAlert('查看详情','<?php echo Router::getBaseUrl();?>/admin_point/orderInfo?orderId=<?php echo $info['id'];?>', '100%','100%')">查看详情</a>
                    <?php if($info['order_status'] == point_orderModel::ORDER_STATUS_PAIED){?>
                    <a href="javascript:;" style="text-decoration:none" onclick="formAlert('订单发货','<?php echo Router::getBaseUrl();?>/admin_point/orderPost?orderId=<?php echo $info['id'];?>', '85%','85%')" >订单发货</a>
                    <?php }?>
                </td>
			</tr>
            <?php }}?>
		</tbody>
	</table>
        <div>
            <?php echo $pageHtml;?>
        </div>
	</div>
</div>
</body>
<?php View::render('admin/layouts/footer'); ?>
<script type="text/javascript">
$(function(){
    window.formAlert = function(title, url, w, h) { 
        layer.open({
            type: 2,
            title: title,
            area: [w, h],
            content: url,
            end: function(){
               window.location.href=location.href;
            }
          });
    }
});
</script>
</html>